package com.event.common.util;

import java.util.concurrent.CompletableFuture;

/**
 * @Description 线程任务上下文
 * @Author Bing
 * @Date 2024/10/30 10:26
 */
public class ThreadTaskContext {

    private static final ThreadLocal<CompletableFuture> THREAD_LOCAL = new ThreadLocal<>();

    public static void set(CompletableFuture future) {
        THREAD_LOCAL.set(future);
    }

    public static CompletableFuture get() {
        return THREAD_LOCAL.get();
    }

    public static void remove() {
        THREAD_LOCAL.remove();
    }
}